import HTTP from "@/tools/http";

const base = "/shopping";

// 获取商品信息
export const info = (data) => HTTP.get("/shopping/goodsinfo", { params: data });
// 商品列表
export const goodsList = (data) => HTTP.get(`${base}/goodslist`, { params: data });

// 购物车列表
export const cartlist = (data) =>
  HTTP.get("/shopping/goodsCartList", { params: data });


// 商城类目列表
export const shoppingTypeList = (params) =>
  HTTP.get(`${base}/shoppingTypeList`, { params });
// 编辑商城类目
export const updateShoppingType = (data) =>
  HTTP.post(`${base}/updateShoppingType`, data);
// 新增商城类目
export const addShoppingType = (data) => HTTP.post(`${base}/addShoppingType`, data);
// 删除商城类目
export const removeShoppingType = (data) =>
  HTTP.post(`${base}/removeShoppingType`, data);

// 商城运费模板列表
export const shoppingCarryTemplateList = (params) =>
  HTTP.get(`${base}/shoppingCarryTemplateList`, { params });
// 店铺运费模板列表
export const storeCarryTemplateList = (params) =>
  HTTP.get(`${base}/storeCarryTemplateList`, { params });
// 新增店铺运费模板
export const addStoreCarryTemplate = (data) =>
  HTTP.post(`${base}/addStoreCarryTemplate`, data);
// 编辑店铺运费模板
export const updateStoreCarryTemplate = (data) =>
  HTTP.post(`${base}/updateStoreCarryTemplate`, data);
// 删除店铺运费模板
export const removeStoreCarryTemplate = (data) =>
  HTTP.post(`${base}/removeStoreCarryTemplate`, data);

// 店铺列表
export const storeList = (params) =>
  HTTP.get(`${base}/storeList`, {
    params,
  });
  // 店铺商品列表
export const storeGoodsList = (data) =>
  HTTP.get(`${base}/storeGoodsList`, { params: data });
// 店铺信息
export const storeInfo = (params) =>
  HTTP.get(`${base}/storeInfo`, {
    params,
  });
// 编辑店铺
export const updateStore = (data) =>
  HTTP.post(`${base}/updateStore`, data);
// 删除店铺
export const removeStore = (data) =>
  HTTP.post(`${base}/removeStore`, data);

// 商城规格列表
export const shoppingSpecsList = (params) =>
  HTTP.get(`${base}/shoppingSpecsList`, {
    params,
  });
// 商品规格列表
export const goodsSpecsList = (params) =>
  HTTP.get(`${base}/goodsSpecsList`, {
    params,
  });
// 新增规格
export const addShoppingSpecs = (data) =>
  HTTP.post("/shopping/addShoppingSpecs", data);
// 删除规格
export const removeShoppingSpecs = (data) =>
  HTTP.post("/shopping/removeShoppingSpecs", data);
// 编辑规格
export const updateShoppingSpecs = (data) =>
  HTTP.post("/shopping/updateShoppingSpecs", data);

// 商城服务列表
export const shoppingServiceList = (params) =>
  HTTP.get(`${base}/shoppingServiceList`, { params });
// 新增服务
export const addShoppingService = (data) =>
  HTTP.post(`${base}/addShoppingService`, data);
// 编辑服务
export const updateShoppingService = (data) =>
  HTTP.post(`${base}/updateShoppingService`, data);
// 删除服务
export const removeShoppingService = (data) =>
  HTTP.post(`${base}/removeShoppingService`, data);

export default {
  shoppingTypeList,
  info,
  goodsList,
  cartlist,
  storeInfo,
  storeList,
  updateStore,
  removeStore,
  shoppingSpecsList,
  addShoppingSpecs,
  removeShoppingSpecs,
  updateShoppingSpecs,
  shoppingServiceList,
};
